var tmp = `
<%var SubPrefix="sub__"%>
<%var ctlTypes = ['rx-textarea', 'rx-group', 'rx-user', 'rx-upload', 'rx-quill-editor', 'rx-radio','rx-form-signbox', 'rx-image','rx-address', 'rx-button-edit', 'rx-map', 'rx-checkbox-list', 'rx-date-range', 'rx-tree-select','rx-relate-process']%>
<div class="rx-attrs-field" v-if="fieldShow('','<%=subTable.alias%>')">
    <div class='sub-table-list-head'>
      <span class="sub-table-list-head-left"><i class="iconfont icon-activity_fill"></i><%=subTable.name%></span>
      <div class="sub-table-list-head-button" @click="customButton(obj)" v-if="!readonly&&subPermission('<%=subTable.alias%>','add')&&tableButtonDef['<%=subTable.alias%>']" v-for="obj in tableButtonDef['<%=subTable.alias%>']">{{obj.name}}</div>
      <div style="color: #ff6262;border: 1px solid #ff6262;" class="sub-table-list-head-button" v-if="!readonly&&subPermission('<%=subTable.alias%>','remove')" @click="removeRow('<%=subTable.alias%>')"><i class="iconfont icon-trash"></i>删除</div>
      <div class="sub-table-list-head-button" v-if="readonly" @click="edit('<%=subTable.alias%>',true)" ><i class="iconfont icon-yanjing"></i>明细</div>
      <div class="sub-table-list-head-button" v-if="!readonly&&subPermission('<%=subTable.alias%>','edit')" @click="edit('<%=subTable.alias%>',false)"><i class="iconfont icon-brush"></i>编辑</div>
      <div class="sub-table-list-head-button" v-if="!readonly&&subPermission('<%=subTable.alias%>','add')" @click="addRow('<%=subTable.alias%>')"><i class="iconfont icon-add"></i>添加</div>
    </div>
    <div class="sub-table-list-content">
      <table class='sub-table-list-table'>
        <tr>
            <th class="sub-table-list-checkbox"><input @click="checkAll('<%=subTable.alias%>')" name="Fruit" type="checkbox" :checked="seleListAll.<%=subTable.alias%>" /></th>
            <%
                for(var i=0;i<subTable.boAttrList.length;i++){
                    var boAttr=subTable.boAttrList[i];%>
                 <th class="sub-table-list-th"><%=boAttr.comment%></th>
                <%}%> 
        </tr>
          <tr v-for="(obj,index) in data.<%=SubPrefix%><%=subTable.alias%>"
            >
             <td class="sub-table-list-checkbox" :class="[obj.selected ? 'form-line-checked':'']" style="background: white;"><input  @click="selectRow(index,'<%=subTable.alias%>')" type="checkbox" :checked="obj.selected" /></td>
            <%  
                for(var i=0;i<subTable.boAttrList.length;i++){
                    var boAttr=subTable.boAttrList[i];%>
                     <td key="<%=i%>" :class="[obj.selected ? 'form-line-checked sub-table-list-line-th':' sub-table-list-line-th']">
                        <div class="<%if(boAttr.break){%> fieid-line-group <%} else {%>fieid-group single_input<%}%>" >
                                <<%=boAttr.control%> v-model="obj.<%=boAttr.name%>" :attrList="attrList" :permission="permission" :metadata="metadata" subname="<%=subTable.alias%>"
                                          :row="obj" :readonly="true" :data="data" attrAlias="<%=boAttr.name%>" />
                        </div>
            </td>
                <%}%> 
          </tr>
      </table>
       <div class="sub-table-list-kong" v-if="data.<%=SubPrefix%><%=subTable.alias%>.length == 0"><i class="iconfont icon-kongxian"></i><span class="sub-table-list-kong-span">数据为空</span></div>

    </div>    
    <!-- 添加数据的弹窗和编辑数据 -->
    <div class="form-popup" v-if="currentTable=='<%=subTable.alias%>'">
      <div class="form-popup-header">{{getTitle('<%=subTable.name%>')}}</div>
      <div class="form-popup-group">
        <div class="form-popup-box">
        <div class="rx-attrs-field" >
        <% for(var i=0;i<subTable.boAttrList.length;i++){
             var boAttr=subTable.boAttrList[i];
             if(boAttr.group&& !boAttr.show){%>
                <div class="attrs-apply">
                <div class="attrs-heard"><%=boAttr.name%></div>
                <% for(var j=0;j<boAttr.list.length;j++){
                    var attr=boAttr.list[j];
                %>
                <div class="<%if(attr.break || ctlTypes.includes(attr.control)){%> rx-fieid fieid-line <%} else {%>rx-fieid<%}%>" >
                      <div>
                        <rx-valid :readonly="action!='add'" :metadata="metadata" subname="<%=subTable.alias%>" :row="tmpRow" :data="data" :attrList="attrList"  attrAlias="<%=attr.name%>"/>
                      </div>
                      
                       <div class="<%if(attr.break){%> fieid-line-group <%} else {%>fieid-group single_input<%}%>" >
                        <<%=attr.control%> v-model="tmpRow.<%=boAttr.name%>" :attrList="attrList" :permission="permission" :metadata="metadata" subname="<%=subTable.alias%>"
                                  :row="tmpRow" :readonly="action!='add'" :data="data" attrAlias="<%=attr.name%>" />
                      </div>
                      <div class="fieid-readonly" v-if="action=='add' && validVtype('<%=attr.name%>','<%=subTable.alias%>')&&!validVtype('<%=attr.name%>','<%=subTable.alias%>').success">
                        {{validVtype('<%=attr.name%>','<%=subTable.alias%>').msg}}
                      </div>
                </div>
                <%}%>r
               </div>
            <%}else{%>
            <div class="<%if(boAttr.break || ctlTypes.includes(boAttr.control)){%> rx-fieid fieid-line <%} else {%>rx-fieid<%}%>" >
                  <div>
                    <rx-valid :readonly="action!='add'" :metadata="metadata" subname="<%=subTable.alias%>" :row="tmpRow" :data="data" :attrList="attrList"  attrAlias="<%=boAttr.name%>"/>
                  </div>
                  
                   <div class="<%if(boAttr.break){%> fieid-line-group <%} else {%>fieid-group single_input<%}%>" >
                    <<%=boAttr.control%> v-model="tmpRow.<%=boAttr.name%>" :attrList="attrList" :permission="permission" :metadata="metadata" subname="<%=subTable.alias%>"
                              :readonly="action=='detail'" :data="data" :row="tmpRow" attrAlias="<%=boAttr.name%>" />
                  </div>
                  <div class="fieid-readonly" v-if="action=='add' && validVtype('<%=boAttr.name%>','<%=type%>')&&!validVtype('<%=boAttr.name%>','<%=type%>').success">
                    {{validVtype('<%=boAttr.name%>','<%=subTable.alias%>').msg}}
                  </div>
            </div>
            <%}%>
        <%}%> 
         <div class="form-popup-tail">
            <button v-if="action!='detail'" class="sub-table-list-popup-confirm" @click='saveRow()' type="primary">确定</button>
            <button @click="currentTable=''" class="sub-table-list-popup-confirm-return">返回</button>
          </div>
         </div>
        </div>
      </div>
    </div>
  </div>
`

export default tmp;